# -*- coding: utf-8 -*-
from odoo import http
import json, datetime, copy, urllib2, time, uuid
from odoo.addons.weixin.api.session_manager import SessionManager
from odoo.exceptions import UserError


class WeixinController(http.Controller):

    # Token 验证
    @http.route('/weixin/do', type='http', auth='public')
    def do(self, token):
        try:
            session = SessionManager()
            if session.has_key(token):
                return True
            else:
                return False
        except Exception as ex:
            return False
